<template>
	<section class="loading-wrapper" :class="{'active': shown}">
		<div class="loader letter-holder">
            <div class="l-1 letter">L</div>
            <div class="l-2 letter">o</div>
            <div class="l-3 letter">a</div>
            <div class="l-4 letter">d</div>
            <div class="l-5 letter">i</div>
            <div class="l-6 letter">n</div>
            <div class="l-7 letter">g</div>
            <div class="l-8 letter">.</div>
            <div class="l-9 letter">.</div>
            <div class="l-10 letter">.</div>
        </div>
	</section>
</template>

<script type="text/javascript">
	export default {
		name: 'loading',
		props: ['shown']
	}	
</script>

<style lang="scss">
	.loading-wrapper {
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;
		background-color: #f7f7f7;
		display: none;
		justify-content: center;
		align-items: center;
		&.active {
			display: flex;
		}
		.letter-holder {padding: 16px;}
		.letter {
		    float: left;
		    font-size: 20px;
		    color: #777;
		}
		.l-1 {animation-delay: .48s;}
		.l-2 {animation-delay: .6s;}
		.l-3 {animation-delay: .72s;}
		.l-4 {animation-delay: .84s;}
		.l-5 {animation-delay: .96s;}
		.l-6 {animation-delay: 1.08s;}
		.l-7 {animation-delay: 1.2s;}
		.l-8 {animation-delay: 1.32s;}
		.l-9 {animation-delay: 1.44s;}
		.l-10 {animation-delay: 1.56s;}
		.loader .letter {
		    animation-name: loadingF;
		    animation-duration: 1.6s;
		    animation-iteration-count: infinite;
		    animation-direction: linear;
		}
	}
	@keyframes loadingF {
	    0% {opacity: 0;}
	    100% {opacity: 1;}
	}
</style>